package com.laolang.shop.modules.product.logic.admin.impl;

import com.github.pagehelper.PageInfo;
import com.laolang.shop.common.core.domain.Page;
import com.laolang.shop.common.core.util.CommonUtil;
import com.laolang.shop.modules.product.logic.admin.ProductAttrAdminLogic;
import com.laolang.shop.modules.product.pojo.attr.admin.vo.ProductAttrPageVo;
import com.laolang.shop.modules.product.service.ProductAttrService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author khlbat
 * @version 1.0
 * @date 2020/11/4 18:53
 */
@AllArgsConstructor
@Slf4j
@Service
public class ProductAttrAdminLogicImpl implements ProductAttrAdminLogic {

    @Autowired
    private final ProductAttrService productAttrService;

    @Override
    public Page<ProductAttrPageVo> page(Integer page, Integer size, Long cateId) {
        PageInfo<ProductAttrPageVo> pageInfo = productAttrService.page(page, size, cateId);
        return CommonUtil.pageInfo2Page(pageInfo);
    }
}
